package cn.tedu.mall1.frist.controller;

import cn.tedu.mall1.base.response.JsonResult;
import cn.tedu.mall1.frist.pojo.eto.LunbotuQuery;
import cn.tedu.mall1.frist.pojo.vo.FristVO;
import cn.tedu.mall1.frist.pojo.vo.LunbotuVO;
import cn.tedu.mall1.frist.service.FristService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/frist")
public class FristController {
    @Autowired
    FristService fristService;

    @GetMapping("lunbotu")
    public JsonResult getLunbotu(LunbotuQuery lunbotuQuery) {
        log.debug("开始处理【获取轮播图】的请求={}", lunbotuQuery);
        List<LunbotuVO> list = fristService.getLunbotu(lunbotuQuery);
        return JsonResult.ok(list);
    }

    @GetMapping("shouye")
    public JsonResult getShouye() {
        log.debug("开始处理【获取首页】的请求");
        List<FristVO> list = fristService.getShouye();
        return JsonResult.ok(list);
    }


}
